<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="./Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <link href="./css/pretty.css" rel="stylesheet">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/config.js"></script>
    <script type="text/javascript" src="./Build/Cesium/Cesium.js"></script>
    <title>2添加图层</title>
</head>

<body>
    <div id="cesiumContainer"></div>

    <script>
        let viewer;
        window.onload = function () {
            window.viewer = viewer = new Cesium.Viewer(
                "cesiumContainer",
                {
                    //创建地形服务提供者的实例，url为SuperMap iServer发布的TIN地形服务
                    terrainProvider: new Cesium.CesiumTerrainProvider({
                        url: URL_CONFIG.SiChuan_TERRAIN,
                        isSct: true,//地形服务源自SuperMap iServer发布时需设置isSct为true
                        invisibility: true
                    }),
                }
            );

            //添加SuperMap iServer发布的影像服务
            var layer = viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                url: URL_CONFIG.SiChuan_IMG
            }));


            viewer.scene.camera.setView({
                destination: new Cesium.Cartesian3(-1206939.1925299785, 5337998.241228442, 3286279.2424502545),
                orientation: {
                    heading: 1.4059101895600987,
                    pitch: -0.20917672793046682,
                    roll: 2.708944180085382e-13
                }
            });
        }
    </script>
</body>

</html>